

;(function (RCABase) {
    var pay_init = {
        extend: {
            index_url: '/admin/Finance/index',
            refund_url: '/admin/Finance/refund',
            ajax_refund_url: '/admin/Finance/ajax_refund',
            jcjs_url: '/admin/Finance/pay_jcjs',//寄存结算
            jcxf_url: '/admin/Finance/pay_jcxf',//寄存续费  停用
            gbf_url: '/admin/Finance/pay_gbf',//工本费   停用
            dj_url : '/admin/Finance/paydeposit',
            order_url: '/admin/Finance/orderpay',
            buried_url: '/admin/Finance/payburied', // 停用
            shoufei_url: '/admin/Finance/shoufei_ajax', // 通用 请求
            table: 'user',
        },
        getTableList:function (tid,url,type,t) {
            var columns=[];
            if (type== 'index_1'){
                columns = [
                    {checkbox:true},
                    {field: 'no', title: '序号', formatter: function (value, row, index) {
                        //获取每页显示的数量
                        var pageSize = $('#table_'+tid ).bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#table_'+tid  ).bootstrapTable('getOptions').pageNumber;
                        //返回序号，注意index是从0开始的，所以要加上1
                        return pageSize * (pageNumber - 1) + index + 1;
                    }},
                    {field: 'pay_sn', title: '收款编号'},
                    {field: 'type', title: '类型', formatter: function (value, row, index) {
                        if (value == 1) return '定金';
                        else if (value == 2) return '结算';
                        else if (value == 3) return '售后';
                        else if (value == 4) return '商品';
                    }},
                    {field: 'total_price', title: '应收金额', class: 'total_price', formatter: function (value, row, index) {
                        if (row.type == 1) {
                            $('#table_' + i + ' thead').find('.total_price').find('.th-inner ').html('定金金额');
                            return row.deposit_price
                        } else {
                            $('#table_' + i + ' thead').find('.total_price').find('.th-inner ').html('应收金额');
                            return row.total_price
                        }
                    }},
                    {field: 'add_time', title: '提交时间'},
                    {field: 'real_name', title: '客户名称'},
                    {field: 'real_phone', title: '联系方式'},
                    {field: 'tomb_num', title: '墓位编号'},
                    {field: 'handle_name', title: '经办人'}, {field: 'pay_type_name', title: '收款方式'},
                    {field: 'operate', title: '操作', align: 'center', events: "operateEventsPay", formatter: function (value, row, index) {
                            var href =  '';
                            if (row.type == 1 || row.type == 2){
                                href +=   ' <a href="javascript:"  class="index_sf">  收款</a>  '
                                href +=   ' <a href="javascript:"  class="index_sf_cz" style="color: red">  重置墓位</a>  '
                            }else {
                                href +=   ' <a href="javascript:"  class="index_sf">  收款</a>  '
                                // href += ' <a href="javascript:" class="index_delete">删除</a>'
                            }
                        return href;
                    }}
                ];
            }else if (type== 'index_2'){
                columns = [
                    {checkbox:true},
                    {
                        field: 'no', title: '序号', formatter: function (value, row, index) {
                            //获取每页显示的数量
                            var pageSize = $('#table_'+tid  ).bootstrapTable('getOptions').pageSize;
                            //获取当前是第几页
                            var pageNumber = $('#table_'+tid  ).bootstrapTable('getOptions').pageNumber;
                            //返回序号，注意index是从0开始的，所以要加上1
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    {field: 'pay_sn', title: '收款编号'},
                    {
                        field: 'type', title: '类型', formatter: function (value, row, index) {
                            if (value == 1) return '定金';
                            else if (value == 2) return '结算';
                            else if (value == 3) return '售后';
                            else if (value == 4) return '商品';
                        }
                    },
                    {
                        field: 'total_price',
                        title: '收款金额',
                        class: 'total_price',
                        formatter: function (value, row, index) {
                            if (row.type == 1) {
                                $('#table_' + tid + ' thead').find('.total_price').find('.th-inner ').html('定金金额');
                                return row.deposit_price
                            } else {
                                $('#table_' + tid + ' thead').find('.total_price').find('.th-inner ').html('收款金额');
                                return row.total_price
                            }
                        }
                    },
                    {
                        field: 'add_time', title: '收款时间', class: 'add_time', formatter: function (value, row, index) {

                            return value;
                        }
                    },
                    {field: 'payrealname', title: '收款人'},
                    {field: 'real_name', title: '客户名称'},
                    {field: 'real_phone', title: '联系方式'},
                    {field: 'tomb_num', title: '墓位编号'},
                    {field: 'handle_name', title: '经办人'},
                    {field: 'pay_type_name', title: '收款方式'},
                    {
                        field: 'operate',
                        title: '操作',
                        align: 'center',
                        events: "operateEventsPay",
                        formatter: function (value, row, index) {
                            var href = '';
                            if (row.type!=2){
                                href += ' <a href="javascript:"  class="dj_td " style="color: red">  重置</a>  '
                            }

                            if (row.is_delete==0){
                                 href+=   ' <a href="javascript:"  class="index_bddj">  收款详情</a>  '
                                // href += ' <a href="javascript:" class="index_bddj">补打单据</a>'
                            }
                            return href;
                        }
                    },
                ];
            }else if (type== 'refund_1'){
                columns = [{checkbox:true},
                {
                    field: 'no', title: '序号', formatter: function (value, row, index) {
                    //获取每页显示的数量
                    var pageSize = $('#table_'+tid ).bootstrapTable('getOptions').pageSize;
                    //获取当前是第几页
                    var pageNumber = $('#table_'+tid ).bootstrapTable('getOptions').pageNumber;
                    //返回序号，注意index是从0开始的，所以要加上1
                    return pageSize * (pageNumber - 1) + index + 1;
                }
                },
                {field: 'refund_sn', title: '退款编号'},
                {
                    field: 'type', title: '类型', formatter: function (value, row, index) {
                    if (value == 1) return '退款';
                    else if (value == 2) return '退墓';
                }
                },
                {field: 'refund_amount', title: '应退金额',},
                {field: 'add_time', title: '审批时间'},
                {field: 'refund_apply_state', title: '审批状态', formatter: function (value, row, index) {
                        if (value == 1) return '审核中';
                        else if (value == 2) return '审核通过';
                        else return '-';
                    }},
                {field: 'real_name', title: '客户名称'},
                {field: 'real_phone', title: '联系方式'},
                {field: 'mw_num', title: '墓位编号'},
                    {field: 'deal_price',
                        title: '成交价格', align: 'center', events: "operateEventsdeal",
                        formatter: function (value, row, index) {
                            var href = ' <a href="javascript:"  class="deal_price">  查看</a> ';
                            return href;
                        }
                    },
                {field: 'add_user_name', title: '业务员/代理人'},
                {field: 'handle_user', title: '经办人'},
                    {
                        field: 'operate',
                        title: '操作',
                        align: 'center',
                        events: "operateEventsPay",
                        formatter: function (value, row, index) {
                            var href = ' <a href="javascript:"  class="refund_RoleOfK">  确认退款</a>  ';
                            return href;
                        }
                    },
                    ];
            }else if (type== 'refund_2'){
                columns = [{checkbox:true},
                    {
                        field: 'no', title: '序号', formatter: function (value, row, index) {
                            //获取每页显示的数量
                            var pageSize = $('#table_'+tid ).bootstrapTable('getOptions').pageSize;
                            //获取当前是第几页
                            var pageNumber = $('#table_'+tid ).bootstrapTable('getOptions').pageNumber;
                            //返回序号，注意index是从0开始的，所以要加上1
                            return pageSize * (pageNumber - 1) + index + 1;
                        }
                    },
                    // {field: 'pay_sn', title: '收款编号'},
                    {field: 'refund_sn', title: '退款编号'},
                    {field: 'type', title: '类型', formatter: function (value, row, index) {
                            if (value == 1) return '退款'; else if (value == 2) return '退墓';}
                    },
                    {field: 'refund_amount', title: '已退金额', class: 'total_price'},
                    {field: 'refund_time', title: '退款时间'},
                    {field: 'refund_user_name', title: '退款人'},
                    {field: 'refund_apply_state', title: '审批状态', formatter: function (value, row, index) {
                            if (value == 1) return '审核中';
                            else if (value == 2) return '审核通过';
                            else return '-';
                        }},
                    {field: 'real_name', title: '客户名称'},
                    {field: 'real_phone', title: '联系方式'},
                    {field: 'mw_num', title: '墓位编号'},
                    {field: 'deal_price', title: '成交价格', align: 'center', events: "operateEventsdeal",
                        formatter: function (value, row, index) {
                            var href = ' <a href="javascript:"  class="deal_price">  查看</a> ';
                            return href;
                        }
                    },
                    {field: 'add_user_name', title: '业务员/代理人'},
                    {field: 'handle_user', title: '经办人'},
                    /*{
                        field: 'operate',
                        title: '操作',
                        align: 'center',
                        events: "operateEventsPay",
                        formatter: function (value, row, index) {
                            var href = ' <a href="javascript:"  class="refund_dc">  导出</a>  ';
                             href+= ' <a href="javascript:"  class="refund_dj">  补打单据</a>  ';
                            return href;
                        }
                    },*/
                ];
            }
            $("#table_"+tid ).bootstrapTable( {
                url: url,
                pageNumber: 1, //初始化加载第一页
                pagination: true,//是否分页
                sidePagination: 'server',//server:服务器端分页|client：前端分页
                pageSize: 10,//单页记录数
                pageList: [ 10, 20,30,50,100],//可选择单页记录数
                showRefresh: false,//刷新按钮
                showColumns: false, //
                columns: columns,
                queryParams: function (params) {
                    //上传服务器的参数
                    var temp = {
                        page: params.offset + 0,// SQL语句起始索引
                        limit: params.limit  // 每页显示数量
                    };
                    return temp;
                },
                formatLoadingMessage: function () {
                    return "数据正在加载中...";
                },
                formatNoMatches: function () {
                    return '无符合条件的记录';
                },
            });
        },
        lookAt:function () {
            layer.open({
                type: 1,
                icon:4, //图标
                title:['办理人信息','color:#383838;font-size:16px;'],
                anim: 2,
                //closeBtn:0,
                // skin: 'layui-layer-rim', //加上边框
                area: ['1220px','540px'], //宽高
                content: $("#info").html()
            });
        },
        jcxf:function(url,n){
            layer.open({
                type: 1, icon: 4, //图标
                title: ['寄存续费', 'color:#383838;font-size:16px;'],
                anim: 2, btn: ['提交'], area: ['750px', '480px'], //宽
                content:
                    '<form class="form-horizontal result_form " action="">\n' +
                    '            <fieldset>\n' +
                    '                <div  class="control-group1-p result_dep" style="border:1px solid #e2e2e2; padding:20px 0 0 20px;">\n' +
                    '                    <div class="row"  style="margin-left: 0;margin-right: 0;">\n' +
                    '                        <div class="col-md-6">\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">办理人姓名</label>\n' +
                    '                                <div class="col-lg-9">' +
                    '                                  <input type="hidden" name="type"  value="1" >\n' +
                    '                                  <input type="hidden" name="deposit_id"  value="' + deposit_id + '" >\n' +
                    '                                    <input type="text" class="form-control" name="buyer_name" placeholder="请输入办理人姓名" value="" >\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label" >手机号码</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control" name="buyer_phone"   value=""  placeholder="请输入手机号码">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">联系地址</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control" name="cart_address"  value=""  placeholder="请输入联系地址">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">与逝者关系</label>\n' +
                    '                                <div class="col-sm-9">\n' +
                    '                                    <input type="text" class="form-control" name="relationship"  value=""  placeholder="请输入与逝者关系">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">续费标椎</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select name="deposit_cost" class="form-control deposit_cost">\n' +
                    '                                            <option value="' + deposit_cost + '">' + deposit_cost + '</option>\n' +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">政策减免</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select name="original_price" id="original_price" class="form-control original_price">\n' + original_price_op +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">收费时间</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control" name="second_name js-date"  value=""  placeholder="收费时间"/>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                        </div>\n' +
                    '                        <div class="col-md-6">\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">性别</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select name="buyer_sex" class="form-control">\n' +
                    '                                        <option value="1">男</option>\n' +
                    '                                        <option value="2">女</option>\n' +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">证件类型</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select name="cart_type" class="form-control">\n' +
                    '                                        <option value="1">身份证</option>\n' +
                    '                                        <option value="2">护照</option>\n' +
                    '                                        <option value="3">军人证</option>\n' +
                    '                                        <option value="4">港澳身份证</option>\n' +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">身份证号</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control" name="cart_num"    placeholder="请输入身份证号">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">交费方式</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select name="pay_type"  class="form-control">\n' +
                    '                                        <option value="1">现金</option>\n' +
                    '                                        <option value="2">转账</option>\n' +
                    '                                        <option value="3">电汇</option>\n' +
                    '                                        <option value="4">微信</option>\n' +
                    '                                        <option value="5">支付宝</option>\n' +
                    '                                        <option value="6">其他</option>\n' +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">续费时长</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <select class="form-control storage_time" id="storage_time" name="storage_time">\n' + storage_time_op +
                    '                                    </select>\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">应收金额</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control total_price" name="total_price"  value="" placeholder="">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                            <div class="form-group">\n' +
                    '                                <label class="control-label">收款人</label>\n' +
                    '                                <div class="col-lg-9">\n' +
                    '                                    <input type="text" class="form-control"  name="second_phone"  value=" " placeholder="">\n' +
                    '                                </div>\n' +
                    '                            </div>\n' +
                    '                        </div>\n' +
                    '                    </div>\n' +
                    '                </div>\n' +
                    '            </fieldset>\n' +
                    '        </form>',
                yes: function (index, layero) {
                    var result_form = $(".result_form").serialize();
                    console.log(result_form)
                    $.post(url, $(".result_form").serialize(), function (result) {
                        if (result.code == 1) {
                            layer.msg("提交成功");
                            window.location.href = result.url;
                        } else {
                            layer.msg(result.msg);
                        }
                    })
                }
            })
        },
        dingjin:function(url,width,height){
            layer.open({
                type: 2, icon: 4, //图标
                title: ['未交款项：', 'color:#383838;font-size:16px;'],
                anim: 2,
                area: [width,height], //宽
                content: url,
            })
        },
    }
    window.operateEventsdeal = {
        'click .deal_price': function (e, value, row, index) {
            console.log(row.deal_price);
            var deal_price = row.deal_price!=null?row.deal_price:"无";
            layer.msg("成交价格："+deal_price);
        }
    }

    window.operateEventsPay = {
        'click .index_sf': function (e, value, row, index) {
            //收费
            if (row.type==1){
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url+"?t=1&order_id="+row.order_id+"&menu=1&pay_id="+row.id,
                    ['750px','350px']);
            }else if (row.type==2){
                if (row.itype==1) {
                    location.href = pay_init.extend.jcjs_url + "?order_id=" + row.order_id + "&menu=1&pay_id=" + row.id;
                } else if (row.itype==3){

                } else if (row.itype==0){
                    location.href = pay_init.extend.order_url + "?order_id=" + row.order_id + "&menu=1&pay_id=" + row.id;
                }
            }else if (row.type==3) {
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url + "?t=3&it=" + row.itype + "&menu=1&order_id=" + row.order_id + "&pay_id=" + row.id,
                    ['750px', '410px']
                )
            }else if (row.type==4) {
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url + "?t=4&it=" + row.itype + "&menu=1&order_id=" + row.order_id + "&pay_id=" + row.id,
                    ['750px', '410px']
                )
            }
        },
        'click .index_sf_cz': function (e, value, row, index) {
            layer.confirm("请慎重操作，确认后将会清除该墓位所有的填写数据！", {
                icon: 3,
                title: "提示", btn: ['确认', '取消']
                , btn1: function () {
                    $.post(pay_init.extend.ajax_refund_url, {type:2,pid:row.id}, function(result){
                        if (result.code == 0) {
                            layer.alert(result.msg, { icon: 5 });
                        } else {
                            layer.confirm(result.msg, {
                                icon: 1, btn: ['确认']
                                , btn1: function () {
                                    window.location.reload();
                                }
                            });
                        }
                    }, 'json');
                }
            })
        },
        'click .index_delete': function (e, value, row, index) {
            //删除
            layer.confirm("请慎重操作，确认后将会清除该所有的数据！", {
                icon: 3,
                title: "提示", btn: ['确认', '取消']
                , btn1: function () {
                    $.post(pay_init.extend.ajax_refund_url, {type:2,pid:row.id}, function(result){
                        if (result.code == 0) {
                            layer.alert(result.msg, { icon: 5 });
                        } else {
                            layer.confirm(result.msg, {
                                icon: 1, btn: ['是']
                                , btn1: function () {
                                    window.location.reload();
                                }
                            });
                        }
                    }, 'json');
                }
            })
        },

        'click .index_xq': function (e, value, row, index) {
            // 收费历史- 详情
        },
        'click .index_bddj': function (e, value, row, index) {
            // 收费历史- 补打单据
            //收费
            if (row.type==1){
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url+"?t=1&order_id="+row.order_id+"&menu=0&pay_id="+row.id,
                    ['750px','350px']);
            }else if (row.type==2){
                if (row.itype==1) {
                    console.log(row.itype)
                    console.log(pay_init.extend.jcjs_url)
                    console.log(row.order_id)
                    location.href = pay_init.extend.jcjs_url + "?order_id=" + row.order_id + "&menu=0&pay_id=" + row.id;
                } else if (row.itype==3){

                } else if (row.itype==0){
                    location.href = pay_init.extend.order_url + "?order_id=" + row.order_id + "&menu=0&pay_id=" + row.id;
                }
            }else if (row.type==3) {
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url + "?t=3&it=" + row.itype + "&menu=0&order_id=" + row.order_id + "&pay_id=" + row.id,
                    ['750px', '410px']
                )
            }else if (row.type==4) {
                RCABase.initBase.ajaxLayerIframeOpen(
                    ['未交款项：', 'color:#383838;font-size:16px;'],
                    pay_init.extend.shoufei_url + "?t=4&it=" + row.itype + "&menu=0&order_id=" + row.order_id + "&pay_id=" + row.id,
                    ['750px', '410px']
                )
            }
        },
        'click .refund_RoleOfK': function (e, value, row, index) {
            //确认退款
            layer.confirm("请慎重操作，确认后将会清除该墓位所有的填写数据！", {
                icon: 3,
                title: "提示", btn: ['是', '否']
                , btn1: function () {
                    $.post(pay_init.extend.ajax_refund_url, {type:1,pid:row.id}, function(result){
                        if (result.code == 0) {
                            layer.alert(result.msg, { icon: 5 });
                        } else {
                            window.location.reload();
                        }
                    }, 'json');
                }
            })
        },
        'click .refund_dc': function (e, value, row, index) {
            //导出
        },
        'click .refund_dj': function (e, value, row, index) {
            //补打单据

        },
    };
    // 查询
    $('#searchware').bind('click',function(){
        var t= $('.nav_tabs').find('.active').data('t');
        var type = $(this).attr('data-type');

        console.log(t)
        console.log(type)
        var room=$('#room').val();
        var real_name=$('#real_name').val();
        var real_phone=$('#real_phone').val();
        var startTime=$('#startData').val();　　//获取开始时间戳
        var endTime=$('#endData').val();　　　　 //获取结束时间戳
        if (type=='index'){
            $("#table_"+type+'_'+t).bootstrapTable('refresh', {url:pay_init.extend.index_url+"?ajax=1&t="+t+"",
                query: {ajax:1,type: room,real_phone:real_phone,real_name:real_name,start_time:startTime,end_time:endTime}});
        } else if (type='refund'){
            $("#table_"+type+'_'+t).bootstrapTable('refresh', {url:pay_init.extend.refund_url+"?ajax=1&t="+t+"",
                query: {ajax:1,type: room,real_phone:real_phone,real_name:real_name,start_time:startTime,end_time:endTime}});
        }
    });

    $('#searchrefresh').bind('click',function () {
        var t= $('.nav_tabs').find('.active').data('t')
        $('input').val('')
        $("#table_"+t).bootstrapTable('refresh', {url:pay_init.extend.index_url+"?ajax=1&t="+t+""});

    });

    //切换显示
    $(document).on('click','.nav_tabs li',function(){
        var t = $(this).data('t');
        var key = $(this).data('key');
        var url = $(this).data('url');
        var wareId=$('#type').val();
        var real_name=$('#real_name').val();
        var real_phone=$('#real_phone').val();
        var startTime=$('#startData').val();　　//获取开始时间戳
        var endTime=$('#endData').val();　　　　 //获取结束时间戳

        if (t == 1) {
            $("#table_"+key).bootstrapTable('refresh', {
                url: url,
                query: {
                    type: wareId,
                    real_phone: real_phone,
                    real_name: real_name,
                    start_time: startTime,
                    end_time: endTime
                }
            });
        } else if (t == 2) {
            pay_init.getTableList(key, url,key);
            $("#table_"+key).bootstrapTable('refresh', {
                url: url,
                query: {
                    type: wareId,
                    real_phone: real_phone,
                    real_name: real_name,
                    start_time: startTime,
                    end_time: endTime
                }
            });
        }

        console.log();
        $(this).addClass('active').siblings().removeClass('active');
        var index = $(".nav_tabs li").index(this);
        var billtype = index;
        $('.content_nav').eq(index).removeClass("feature").siblings().addClass("feature");
    });
    if(index_type=='index'){
        pay_init.getTableList('index_1', pay_init.extend.index_url + "?ajax=1&t=1",'index_1' );
    } else if (index_type=='refund') {
        pay_init.getTableList('refund_1', pay_init.extend.refund_url + "?ajax=1&t=1",'refund_1' );
    }else{
    }


    RCABase.init_pay = pay_init;
})(RCABase);
